<template>
  <div class="feedback">
    <x-header :left-options="{backText: ''}">意见反馈</x-header>
    <div style="background: #fff;border-top: 1px solid #f6f6f6;">
      <textarea name="" :class="{textareaSty:!feedback,hasTextareaSty:feedback}" cols="30" rows="10" placeholder="请详细描述您的问题与建议,我们将及时跟进处理(如有其它问题请添加相关截图)"
        v-model="feedback"></textarea>
      <!-- <span style="color:#999;">上传图片</span> -->
    </div>
    <div class="feedbackPhone">
      <span>手机号/邮箱/QQ</span>
      <input type="text" placeholder="选填一项,方便我们联系您" v-model="phoneNum">
    </div>
    <div class="submitBtn" @click="sendBtn()">
      <div class="btn">提交</div>
      <span style="color:#ff1010;font-size:14px;">提示:凡参与"意见反馈"的用户,一经采纳将会获得1w-20w的bncn奖励</span>
    </div>
  </div>
</template>
<script>
  import { XHeader } from 'vux'
  import http from '../../service/http.js'
  import tips from '../../service/tips.js'
  export default {
    data() {
      return {
        phoneNum: "",
        feedback: "",
      }
    },
    methods: {
      sendBtn() {
        if (!this.feedback) {
          tips.tips("请填写反馈");
          return false;
        }
        if (!this.phoneNum) {
          tips.tips("请填写联系方式");
          return false
        }
        http.put("/user/advice", {
          touchId: this.phoneNum,
          content: this.feedback
        }).then((res) => {
          if (res.status == 200) {
            tips.tips("反馈成功");
          } else {
            tips.tips("反馈失败")
          }
        }).catch((res) => {
          tips.tips(res.msg)
        })
      }
    },
    components: {
      XHeader,
    }
  }
</script>
<style lang="less">
  .feedback{
    position: fixed;
    top: 0px;
    bottom: 0px;
    left: 0px;
    right: 0px;
    background: #f6f6f6 !important;
  }
  .feedback .vux-header {
    background: #fff;
  }

  .c6 {
    color: #666;
  }

  .fr {
    position: relative;
  }

  .fa {
    position: absolute;
  }

  .r10 {
    right: 10px;
    ;
  }

  .c9 {
    color: #999;
  }

  .feedback .transactionMoeny {
    position: absolute;
    right: 10px;
  }

  .feedback .vux-header .vux-header-left .left-arrow:before {
    content: "";
    position: absolute;
    width: 12px;
    height: 12px;
    border: 1px solid #000;
    border-width: 1px 0 0 1px;
    -webkit-transform: rotate(315deg);
    transform: rotate(315deg);
    top: 8px;
    left: 7px;
  }

  .feedback .vux-header .vux-header-title {
    line-height: 40px;
    text-align: center;
    font-size: 18px;
    font-weight: 400;
    color: #000;
  }

  .feedbackPhone {
    margin-top: 10px;
    background: #fff;
    height: 55px;
    line-height: 55px;
    padding-left: 15px;
    input {
      display: inline-block;
      height: 55px;
      line-height: 55px;
      border: none;
      outline: none;
      width: 59%;
    }
  }

  .feedback .submitBtn {
    padding: 0px 15px;
    margin-top: 60px;
    .btn {
      margin-bottom: 20px;
      height: 40px;
      line-height: 40px;
      color: #fff;
      background: linear-gradient(left, #fedd32, #fe9e09);
      background: -webkit-gradient(linear, left top, right top, from(#fedd32), to(#fe9e09));
      text-align: center;
      border-radius: 25px;
    }
  }

  .feedback .textareaSty {
    display: block;
    width: 92%;
    font-size: 13px;
    padding: 10px 10px 10px 15px;
    border: none;
    outline: none;
    height: 110px;
  }

  .feedback .hasTextareaSty {
    display: block;
    width: 92%;
    font-size: 15px;
    padding: 10px 10px 10px 15px;
    border: none;
    outline: none;
    height: 110px;
  }
</style>